<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var newData = {}//computed
        var data = '呵呵哒'//data=>{}
        //核心的数据监听---vue底层原理
        Object.defineProperty(newData,'name',{
            get(){
                console.log('获取值')
                return data;
            },
            set(value){
                console.log('设置值',value)
                data = value;
            }
        });

        //获取值：
        newData.name
    </script>
</body>
</html>